<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var test1 = ''
        var test2 = 0
        var test3 = []
        var test4 = {}
        var test5 = null
        var test6 = undefined
        // if-else判断的时候，隐式转换为false的值
        // 空字符串 | '' --- false
        // 0 --- false
        // [].length --- false
        // null --- false
        // undefined --- false

        /*
        typeof !!'string' === 'string'
        */

        if (!test1) {
            console.log('test1-succes')
        }
        if (!test2) {
            console.log('test2-succes')
        }
        if (!test3) {
            console.log('test3-succes')
        }
        if (!test4) {
            console.log('test4-succes')
        }
        if (!test5) {
            console.log('test5-succes')
        }
        if (!test6) {
            console.log('test6-succes')
        }
    </script>
</body>

</html>